document.writeln("<!DOCTYPE html>");
document.writeln("<html lang=\"zh-CN\">");
document.writeln("<head>");
document.writeln("    <meta charset=\"UTF-8\">");
document.writeln("    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">");
document.writeln("    <title>IPGPS 访问追踪系统 - 导航中心</title>");
document.writeln("    <style>");
document.writeln("        * {");
document.writeln("            margin: 0;");
document.writeln("            padding: 0;");
document.writeln("            box-sizing: border-box;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        body {");
document.writeln("            font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, \'Helvetica Neue\', Arial, sans-serif;");
document.writeln("            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);");
document.writeln("            min-height: 100vh;");
document.writeln("            padding: 20px;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .container {");
document.writeln("            max-width: 1200px;");
document.writeln("            margin: 0 auto;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .header {");
document.writeln("            text-align: center;");
document.writeln("            color: white;");
document.writeln("            margin-bottom: 40px;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .header h1 {");
document.writeln("            font-size: 2.5rem;");
document.writeln("            margin-bottom: 10px;");
document.writeln("            text-shadow: 0 2px 4px rgba(0,0,0,0.3);");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .header p {");
document.writeln("            font-size: 1.2rem;");
document.writeln("            opacity: 0.9;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .nav-grid {");
document.writeln("            display: grid;");
document.writeln("            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));");
document.writeln("            gap: 30px;");
document.writeln("            margin-bottom: 40px;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .nav-card {");
document.writeln("            background: white;");
document.writeln("            border-radius: 15px;");
document.writeln("            padding: 30px;");
document.writeln("            box-shadow: 0 10px 30px rgba(0,0,0,0.1);");
document.writeln("            transition: transform 0.3s ease, box-shadow 0.3s ease;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .nav-card:hover {");
document.writeln("            transform: translateY(-5px);");
document.writeln("            box-shadow: 0 15px 40px rgba(0,0,0,0.15);");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .nav-card h2 {");
document.writeln("            color: #333;");
document.writeln("            margin-bottom: 15px;");
document.writeln("            font-size: 1.5rem;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .nav-card p {");
document.writeln("            color: #666;");
document.writeln("            margin-bottom: 20px;");
document.writeln("            line-height: 1.6;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .nav-links {");
document.writeln("            display: flex;");
document.writeln("            flex-direction: column;");
document.writeln("            gap: 10px;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .nav-link {");
document.writeln("            display: inline-block;");
document.writeln("            padding: 12px 20px;");
document.writeln("            background: linear-gradient(135deg, #667eea, #764ba2);");
document.writeln("            color: white;");
document.writeln("            text-decoration: none;");
document.writeln("            border-radius: 8px;");
document.writeln("            transition: background 0.3s ease;");
document.writeln("            text-align: center;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .nav-link:hover {");
document.writeln("            background: linear-gradient(135deg, #5a6fd8, #6a4190);");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .nav-link.secondary {");
document.writeln("            background: #f8f9fa;");
document.writeln("            color: #495057;");
document.writeln("            border: 1px solid #dee2e6;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .nav-link.secondary:hover {");
document.writeln("            background: #e9ecef;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .feature-list {");
document.writeln("            list-style: none;");
document.writeln("            margin: 15px 0;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .feature-list li {");
document.writeln("            padding: 5px 0;");
document.writeln("            color: #666;");
document.writeln("            position: relative;");
document.writeln("            padding-left: 20px;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .feature-list li::before {");
document.writeln("            content: \"✓\";");
document.writeln("            position: absolute;");
document.writeln("            left: 0;");
document.writeln("            color: #28a745;");
document.writeln("            font-weight: bold;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .stats {");
document.writeln("            background: white;");
document.writeln("            border-radius: 15px;");
document.writeln("            padding: 30px;");
document.writeln("            box-shadow: 0 10px 30px rgba(0,0,0,0.1);");
document.writeln("            text-align: center;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .stats h3 {");
document.writeln("            color: #333;");
document.writeln("            margin-bottom: 20px;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .stat-item {");
document.writeln("            display: inline-block;");
document.writeln("            margin: 0 20px;");
document.writeln("            padding: 20px;");
document.writeln("            background: #f8f9fa;");
document.writeln("            border-radius: 10px;");
document.writeln("            min-width: 150px;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .stat-number {");
document.writeln("            font-size: 2rem;");
document.writeln("            font-weight: bold;");
document.writeln("            color: #667eea;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .stat-label {");
document.writeln("            color: #666;");
document.writeln("            margin-top: 5px;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .embed-code {");
document.writeln("            background: #f8f9fa;");
document.writeln("            border: 1px solid #dee2e6;");
document.writeln("            border-radius: 8px;");
document.writeln("            padding: 15px;");
document.writeln("            margin: 15px 0;");
document.writeln("            font-family: \'Courier New\', monospace;");
document.writeln("            font-size: 14px;");
document.writeln("            overflow-x: auto;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .warning {");
document.writeln("            background: #fff3cd;");
document.writeln("            border: 1px solid #ffeaa7;");
document.writeln("            color: #856404;");
document.writeln("            padding: 15px;");
document.writeln("            border-radius: 8px;");
document.writeln("            margin: 20px 0;");
document.writeln("        }");
document.writeln("        ");
document.writeln("        .warning strong {");
document.writeln("            color: #856404;");
document.writeln("        }");
document.writeln("    </style>");
document.writeln("</head>");
document.writeln("<body>");
document.writeln("    <div class=\"container\">");
document.writeln("        <div class=\"header\">");
document.writeln("            <h1>🚀 IPGPS 访问追踪系统</h1>");
document.writeln("            <p>最小化数据收集 · 隐私优先 · 实时追踪</p>");
document.writeln("        </div>");
document.writeln("");
document.writeln("        <div class=\"nav-grid\">");
document.writeln("            <!-- 数据收集模块 -->");
document.writeln("            <div class=\"nav-card\">");
document.writeln("                <h2>📊 数据收集</h2>");
document.writeln("                <p>多种方式收集访问数据，支持GPS定位和隐私保护</p>");
document.writeln("                <ul class=\"feature-list\">");
document.writeln("                    <li>匿名化IP地址</li>");
document.writeln("                    <li>可选GPS位置追踪</li>");
document.writeln("                    <li>User-Agent哈希</li>");
document.writeln("                    <li>用户同意机制</li>");
document.writeln("                </ul>");
document.writeln("                <div class=\"nav-links\">");
document.writeln("                    <a href=\"http://aifk.site/index.php\" class=\"nav-link\">📱 访问诊断页</a>");
document.writeln("                    <a href=\"http://aifk.site/pixel.php\" class=\"nav-link secondary\">🎯 像素追踪</a>");
document.writeln("                </div>");
document.writeln("            </div>");
document.writeln("");
document.writeln("            <!-- 数据管理模块 -->");
document.writeln("            <div class=\"nav-card\">");
document.writeln("                <h2>🔧 数据管理</h2>");
document.writeln("                <p>查看、筛选、导出和分析收集的访问数据</p>");
document.writeln("                <ul class=\"feature-list\">");
document.writeln("                    <li>按日期筛选数据</li>");
document.writeln("                    <li>CSV格式导出</li>");
document.writeln("                    <li>地理位置查看</li>");
document.writeln("                    <li>数据清理功能</li>");
document.writeln("                </ul>");
document.writeln("                <div class=\"nav-links\">");
document.writeln("                    <a href=\"admin_file.php\" class=\"nav-link\">📁 文件存储管理</a>");
document.writeln("                    <!-- <a href=\"admin.php\" class=\"nav-link\">🗄️ 数据库管理</a> -->");
document.writeln("                </div>");
document.writeln("            </div>");
document.writeln("");
document.writeln("            <!-- 集成使用模块 -->");
document.writeln("            <div class=\"nav-card\">");
document.writeln("                <h2>🔗 集成使用</h2>");
document.writeln("                <p>将追踪系统集成到您的网站或应用中</p>");
document.writeln("                <div class=\"embed-code\">");
document.writeln("                    &lt;!-- 像素追踪 --&gt;");
document.writeln("                    &lt;img src=\"pixel.php\" width=\"1\" height=\"1\" style=\"display:none\"&gt;");
document.writeln("                </div>");
document.writeln("                <div class=\"embed-code\">");
document.writeln("                    &lt;!-- JavaScript追踪 --&gt;");
document.writeln("                    &lt;script src=\"wyzjs.js\"&gt;&lt;/script&gt;");
document.writeln("                </div>");
document.writeln("                <div class=\"nav-links\">");
document.writeln("                    <a href=\"cs.html\" class=\"nav-link secondary\">📚 集成示例</a>");
document.writeln("                    <a href=\"short.php\" class=\"nav-link secondary\">🔗 短链接测试</a>");
document.writeln("                </div>");
document.writeln("            </div>");
document.writeln("        </div>");
document.writeln("");
document.writeln("        <div class=\"warning\">");
document.writeln("            <strong>⚠️ 安全提醒：</strong>");
document.writeln("            <p>");
document.writeln("                本系统仅供学习和研究使用，请勿将追踪数据用于商业用途。");
document.writeln("                <br>");
document.writeln("                如需商用，请联系作者wsyh1024@qq.com！");
document.writeln("            </p>");
document.writeln("            <!-- 请及时修改 <code>config.php</code> 中的默认管理员密码和数据库配置！ -->");
document.writeln("        </div>");
document.writeln("");
document.writeln("        <div class=\"stats\">");
document.writeln("            <h3>📈 系统状态</h3>");
document.writeln("            <div class=\"stat-item\">");
document.writeln("                <div class=\"stat-number\" id=\"logCount\">-</div>");
document.writeln("                <div class=\"stat-label\">今日记录</div>");
document.writeln("            </div>");
document.writeln("            <div class=\"stat-item\">");
document.writeln("                <div class=\"stat-number\" id=\"fileCount\">-</div>");
document.writeln("                <div class=\"stat-label\">日志文件</div>");
document.writeln("            </div>");
document.writeln("            <div class=\"stat-item\">");
document.writeln("                <div class=\"stat-number\" id=\"lastUpdate\">-</div>");
document.writeln("                <div class=\"stat-label\">最后更新</div>");
document.writeln("            </div>");
document.writeln("        </div>");
document.writeln("    </div>");
document.writeln("");
document.writeln("    <script>");
document.writeln("        // 动态获取系统状态 - 使用专用API");
document.writeln("        function updateStats() {");
document.writeln("            fetch(\'api_stats.php\')");
document.writeln("                .then(response => response.json())");
document.writeln("                .then(data => {");
document.writeln("                    document.getElementById(\'logCount\').textContent = data.today_count;");
document.writeln("                    document.getElementById(\'fileCount\').textContent = data.file_count;");
document.writeln("                    document.getElementById(\'lastUpdate\').textContent = data.current_time;");
document.writeln("                })");
document.writeln("                .catch(error => {");
document.writeln("                    console.error(\'获取统计数据失败:\', error);");
document.writeln("                    document.getElementById(\'logCount\').textContent = \'-\';");
document.writeln("                    document.getElementById(\'fileCount\').textContent = \'-\';");
document.writeln("                    document.getElementById(\'lastUpdate\').textContent = new Date().toLocaleTimeString(\'zh-CN\');");
document.writeln("                });");
document.writeln("        }");
document.writeln("");
document.writeln("        // 页面加载时立即更新状态");
document.writeln("        updateStats();");
document.writeln("        ");
document.writeln("        // 每5秒更新一次（实时更新）");
document.writeln("        setInterval(updateStats, 5000);");
document.writeln("        ");
document.writeln("        // 页面可见性改变时立即更新");
document.writeln("        document.addEventListener(\'visibilitychange\', function() {");
document.writeln("            if (!document.hidden) {");
document.writeln("                updateStats();");
document.writeln("            }");
document.writeln("        });");
document.writeln("        ");
document.writeln("        // 页面激活时更新");
document.writeln("        window.addEventListener(\'focus\', updateStats);");
document.writeln("    </script>");
document.writeln("</body>");
document.writeln("</html>");